package com.haotunet.app.goldtreasure.adapter;

import java.util.List;
import com.haotunet.app.goldtreasure.R;
import com.haotunet.app.goldtreasure.model.WithDrawRecordInfo;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

public class WithdrawalsRcdAdapter extends HolderAdapter<WithDrawRecordInfo, WithdrawalsRcdAdapter.ViewHolder> {

	public WithdrawalsRcdAdapter(Context context, List<WithDrawRecordInfo> mlist) {
		super(context, mlist);
	}

	public static class ViewHolder {
		TextView tvState;
		TextView tvDate;
		TextView tvAmount;
	}

	@Override
	public View buildConvertView(LayoutInflater layoutInflater, WithDrawRecordInfo t, int position) {
		return inflate(R.layout.item_withdrawals_record);
	}

	@Override
	public ViewHolder buildHolder(View convertView, WithDrawRecordInfo t, int position) {
		ViewHolder holder = new ViewHolder();
		holder.tvState = (TextView) convertView.findViewById(R.id.txt_withdrawals_state);
		holder.tvDate = (TextView) convertView.findViewById(R.id.txt_date);
		holder.tvAmount = (TextView) convertView.findViewById(R.id.txt_withdrawals_amount);
		return holder;
	}

	@Override
	public void bindViewDatas(View convertView,ViewHolder holder, WithDrawRecordInfo withDrawRecordInfo, int position) {
		holder.tvDate.setText(withDrawRecordInfo.getCreateTime());
		holder.tvAmount.setText(withDrawRecordInfo.getValue());
		holder.tvState.setText(withDrawRecordInfo.getTexPrompt());
	}
}
